﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Coronox.SkyShell;
using System.IO;

namespace SkyShellLibTestConsole
{
    class Program
    {
        static void Main(string[] args)
        {

            //Console.WriteLine("SkyDrive installed: {0}", SkyDrive.IsInstalled());
            //Console.WriteLine("SkyDrive UserFolder: {0}", SkyDrive.GetSkyDriveFolder());
          
            ////prepare a folder
            //string tesdir  = @"c:\skyshellTest";
            //Console.WriteLine("preparing test folder {0}", tesdir);
            //var testDi = Directory.CreateDirectory(tesdir);

            //string targetDir = Path.Combine(SkyDrive.GetSkyDriveFolder(), testDi.Name);

            //Console.WriteLine("moving test folder {0} to {1}", tesdir, targetDir);
            //if (FolderOperator.Move(tesdir, targetDir,true))
            //{
            //    System.Threading.Thread.Sleep(2000);
            //    Console.WriteLine("creating surrogate folder {0} to {1}", tesdir, targetDir);
            //    if (FolderOperator.CreateSurrogate(tesdir, targetDir))
            //    {
            //        //create a file
            //        File.WriteAllText(tesdir + "\\test.txt", "Hello World");
            //        System.Threading.Thread.Sleep(9000);
            //        Console.WriteLine("undo surrogate folder {0} to {1}", tesdir, targetDir);
            //        if (FolderOperator.DeleteSurrogate(tesdir))
            //        {
            //            System.Threading.Thread.Sleep(2000);
            //            Console.WriteLine("moving test folder back {1} to {0}", tesdir, targetDir);
            //            if (FolderOperator.Move(targetDir, tesdir,true))
            //            {
            //                System.Threading.Thread.Sleep(2000);
            //            }
            //            else
            //            {
            //                Console.WriteLine("moving test folder back {1} to {0}, failed", tesdir, targetDir);
            //            }
            //        }
            //        else
            //        {
            //            Console.WriteLine("undo surrogate folder {0} to {1}, failed", tesdir, targetDir);
            //        }
            //    }
            //    else
            //    {
            //        Console.WriteLine("creating surrogate folder {0} to {1}, failed", tesdir, targetDir);
            //    }
            //}
            //else
            //{
            //    Console.WriteLine("moving test folder {0} to {1}, failed", tesdir, targetDir);
            //}
            
            //Console.ReadLine();
        }
    }
}
